#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);


    QPalette pal = this->palette();

    pal.setBrush( QPalette::Background,QBrush(QPixmap(":/white.jpg")));

//    pal.setBrush(QPalette::Background,QBrush(Qt::blue));
//    pal.setBrush(QPalette::Background,QBrush(QColor(95,158,160)));



    this->setPalette(pal);

    ui->pushButton_2->setIcon(QIcon(":/zidong.png"));
    ui->pushButton_2->setIconSize(QSize(48,48));


    ui->pushButton->setIcon(QIcon(":/dangqian.png"));
    ui->pushButton->setIconSize(QSize(48,48));



    ui->pushButton_5->setIconSize(QSize(48,48));
    ui->pushButton_5->setIcon(QIcon(":/switch_off.png"));




  //  ui->label_5->setFixedSize(200,200);
    ui->label_5->setScaledContents(true);

     movie = new QMovie(":/fan2.gif");

    ui->label_5->setMovie(movie);

    movie->start();

    movie->stop();



}

Widget::~Widget()
{
    delete ui;
}




void Widget::on_pushButton_5_clicked()
{
    static bool flg = true;

    if(flg){

        ui->pushButton_5->setIcon(QIcon(":/switch_on.png"));
        movie->start();
        flg = false;
    }
    else{

        ui->pushButton_5->setIcon(QIcon(":/switch_off.png"));
        movie->stop();
        flg = true;
    }
}
